package com.ctbri.containerindepth;

import java.util.Comparator;
import java.util.SortedSet;
import java.util.TreeSet;

import com.ctbri.arrays.RandomGenerator;

public class Ex9 {

	public static void main(String[] args) {
		SortedSet<String> treeSet = new TreeSet<>(new Comparator<String>() {
			@Override
			public int compare(String o1, String o2) {
				return o1.charAt(0) - o2.charAt(0);
			}
		});
		RandomGenerator.String strGenerator = new RandomGenerator.String();
		for(int i = 0; i < 10; i++){
			treeSet.add(strGenerator.next());
		}
		System.out.println(treeSet);
	}

}
